<!--
 * @Descripttion: 
 * @version: 
 * @Author: wtzhang
 * @Date: 2021-08-06 13:55:59
 * @LastEditors: wtzhang
 * @LastEditTime: 2021-08-06 14:16:52
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let arr1 = [1,2, 3, 4, 5]
    console.log(...arr1);
    let obj1 = {name: 'jack', age: '18', sex: 'male'}
    // console.log(...obj1); // 报错error:Found non-callable @@iterator，展开运算符不能展开对象
    console.log({...obj1}); // {name: "jack", age: "18", sex: "male"}
    // 传递修改属性
    let obj2 = {...obj1, name:'rose', sex: 'femal'}
    console.log(obj2);
  </script>
</body>
</html>